﻿using System.Windows.Media;
using C1.Silverlight.Pdf;
using System.Windows;

namespace MyFloridaHouse.libSvOpenDistricts.PDF
{
    public static class HouseMapTitle
    {
        public static void Draw(C1PdfDocument pdf, Rect titleRect,  string titleText, Pen borderPen)
        {
            
            double padding = 1;

            if (string.IsNullOrEmpty(titleText))
            {
                titleText = string.Empty;
            }

            if (null != borderPen)
            {
                // Draw Border
                // title is not drawing centered, so remove border and make it not so apparent
                //pdf.DrawRectangle(borderPen, titleRect);
            }

            // Draw Title

            PDFString title = new PDFString(pdf, "Arial", titleRect.Height - 2 * padding, PdfFontStyle.Bold, Colors.Black, titleText.ToUpper(), padding);
            title.FitFontSize(titleRect.Width, titleRect.Height);
            title.DrawCenteredX(titleRect);

        }

    }
}
